<?php
/**
 * Created by PhpStorm.
 * User: zhuyujun
 * Date: 2017/10/26
 * Time: 11:18
 */

namespace App\Eloquent\Ygt;

use Framework\BaseClass\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;


class OrderType extends DbEloquent
{
    use SoftDeletes;
    protected $dates = ['deleted_at'];
    protected $table = 'ygt_order_type';

/*    public function getOrderTypeList()
    {
        $result = self::with(['process'])->get();
        return $result;
    }*/

    public function process()
    {
        return $this->belongsToMany('App\Eloquent\Ygt\Process', 'ygt_process_ordertype', 'ordertype_id', 'process_id')->whereNull('ygt_process_ordertype.deleted_at')->withPivot('step_number')->orderBy('step_number');
//        return $this->hasMany('App\Eloquent\Ygt\ProcessOrdertype','ordertype_id');
    }



}